package com.soft.javase.day03.practice.employeeandmanger;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/17
 */
class Manager extends Employee {
    private double bonus;

    public Manager(String name, String id, double pay, double bonus) {
        super(name, id, pay);
        this.bonus = bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    // 实现涨薪方法 - 经理涨薪同时增加分红
    @Override
    public void addSalary(double amount) {
        setPay(getPay() + amount);
        this.bonus += amount * 0.1; // 涨薪10%作为额外分红
    }

}